I have created a simple React application that works locally, but for some reason, Heroku keeps giving me this error message when I try to deploy it. I have been googling for solutions and trying everything I can find, but this error still persists. I am still a beginner in this, and would gladly appreciate any help or advice. If anyone would like to try it, my repository which I am trying to deploy from is https://github.com/shittake/findabudbud. Thank you in advance.
-----> Build Running build
> findabudbud@1.0.0 build
> react-scripts build
node:internal/modules/cjs/loader:361 throw err; ^ Error: Cannot find module '/tmp/build_2e0389cc/node_modules/fs-extra/lib/index.js'. Please verify that the package.json has a valid "main" entry at tryPackage (node:internal/modules/cjs/loader:353:19) at Function.Module._findPath (node:internal/modules/cjs/loader:566:18) at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (/tmp/build_2e0389cc/node_modules/react-scripts/scripts/build.js:36:12) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) { code: 'MODULE_NOT_FOUND', path: '/tmp/build_2e0389cc/node_modules/fs-extra/package.json', requestPath: 'fs-extra' } -----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- node_modules checked into source control
https://devcenter.heroku.com/articles/node-best-practices#only-git-the-important-bits
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app. ! Push failed